package com.cuit.blog.config;

import com.cuit.blog.filter.RedirectFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WebConfig {

    @Bean
    public FilterRegistrationBean<RedirectFilter> redirectFilter() {
        FilterRegistrationBean<RedirectFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new RedirectFilter());
        registrationBean.addUrlPatterns("/*");
        return registrationBean;
    }
}
